---
title: "Make Figures in R"



rm(list = ls(all = TRUE))
library(ggplot2)
library(rworldmap)
library(RColorBrewer)





#########################################################
##  Figure 2: Communicative Strategies Over Time 
#########################################################


library(haven)
LSS <- read_dta("estimation_file.dta")


ggplot(subset(LSS, country=="Russia"), 
       aes(x=year)) +
  theme_bw() +
  geom_point(aes(y= lss_econ), colour = "grey87", alpha = 0.2) +
  geom_smooth(aes(y= lss_econ, colour = "lss_econ"), alpha = 0.9, se = FALSE) +
    geom_point(aes(y= lss_fight), colour = "black", alpha = 0.2) +
  geom_smooth(aes(y= lss_fight, colour = "lss_fight"), alpha = 0.9, se = FALSE, span=0.4) +
      geom_point(aes(y= lss_nation), colour = "grey55", alpha = 0.2) +
  geom_smooth(aes(y= lss_nation, colour = "lss_nation"), alpha = 0.9, se = FALSE) +
  ggtitle("Russia") + 
  ylab("Score") + xlab("") + 
  scale_y_continuous(limits=c(-0.4, 0.4)) +
  scale_x_continuous(limits=c(1991, 2019), 
                     breaks = c(1991, 1996,  2000, 2004, 2004, 2008, 2012, 2014, 2019)) +
                       scale_color_manual(name = "",
values = c( "lss_econ" = "grey87", "lss_fight" = "black", "lss_nation" = "grey55"),
labels = c("Responsiveness", "Intimidation", "Patriotism")) +
  theme(legend.position="none", plot.title = element_text(hjust = 0.5, size=16), axis.text=element_text(size=10),
         axis.title=element_text(size=14)) 
ggsave("output/Russia_LSS3.pdf")


ggplot(subset(LSS, country=="Belarus"), 
       aes(x=year, group = country, linetype = country, colour = country)) +
  theme_bw() +
  geom_point(aes(y= lss_econ), colour = "grey87", alpha = 0.2) +
  geom_smooth(aes(y= lss_econ, colour = "lss_econ"), alpha = 0.9, se = FALSE) +
    geom_point(aes(y= lss_fight), colour = "black", alpha = 0.2) +
  geom_smooth(aes(y= lss_fight, colour = "lss_fight"), alnationpha = 0.9, se = FALSE, span=0.4) +
      geom_point(aes(y= lss_nation), colour = "grey55", alpha = 0.2) +
  geom_smooth(aes(y= lss_nation, colour = "lss_nation"), alpha = 0.9, se = FALSE) +
  ggtitle("Belarus") + 
  ylab("Score") + xlab("") + 
 # scale_y_continuous(limits=c(0, 60), breaks = c(1, 25, 50 )) +
    scale_y_continuous(limits=c(-0.4, 0.4)) +
    scale_x_continuous(limits=c(1991, 2019), 
                     breaks = c(1991, 1994, 1996,  2000, 2004, 2004, 2008, 2012, 2014, 2019)) +
                                          scale_color_manual(name = "",
values = c( "lss_econ" = "grey87", "lss_fight" = "black", "lss_nation" = "grey55"),
labels = c("Responsiveness", "Intimidation", "Patriotism")) +
  theme(legend.position="none", plot.title = element_text(hjust = 0.5, size=16), axis.text=element_text(size=10),
         axis.title=element_text(size=14)) 
ggsave("output/Belarus_LSS3.pdf")



ggplot(subset(LSS, country=="Kazakhstan"), 
       aes(x=year, group = country, linetype = country, colour = country)) +
  theme_bw() +
  geom_point(aes(y= lss_econ), colour = "grey87", alpha = 0.2) +
  geom_smooth(aes(y= lss_econ, colour = "lss_econ"), alpha = 0.9, se = FALSE) +
    geom_point(aes(y= lss_fight), colour = "black", alpha = 0.2) +
  geom_smooth(aes(y= lss_fight, colour = "lss_fight"), alpha = 0.9, se = FALSE, span=0.4) +
      geom_point(aes(y= lss_nation), colour = "grey55", alpha = 0.2) +
  geom_smooth(aes(y= lss_nation, colour = "lss_nation"), alpha = 0.9, se = FALSE) +
  ggtitle("Kazakhstan") + 
  ylab("Score") + xlab("") + 
    scale_y_continuous(limits=c(-0.4, 0.4)) +
    scale_x_continuous(limits=c(1991, 2019),
                     breaks = c(1991, 1996,  2000, 2004, 2004, 2008, 2012, 2014, 2019)) +
      scale_color_manual(name = "",
values = c( "lss_econ" = "grey87", "lss_fight" = "black", "lss_nation" = "grey55"),
labels = c("Responsiveness", "Intimidation", "Patriotism")) +
  theme(legend.position="none", plot.title = element_text(hjust = 0.5, size=16), axis.text=element_text(size=10),
         axis.title=element_text(size=14)) 
ggsave("output/Kazakhstan_LSS3.pdf")


ggplot(subset(LSS, country=="Azerbaijan"), 
       aes(x=year, group = country, linetype = country, colour = country)) +
  theme_bw() +
  geom_point(aes(y= lss_econ), colour = "grey87", alpha = 0.2) +
  geom_smooth(aes(y= lss_econ, colour = "lss_econ"), alpha = 0.9, se = FALSE) +
    geom_point(aes(y= lss_fight), colour = "black", alpha = 0.2) +
  geom_smooth(aes(y= lss_fight, colour = "lss_fight"), alpha = 0.9, se = FALSE, span=0.4) +
      geom_point(aes(y= lss_nation), colour = "grey55", alpha = 0.2) +
  geom_smooth(aes(y= lss_nation, colour = "lss_nation"), alpha = 0.9, se = FALSE) +
  ggtitle("Azerbaijan") + 
  ylab("Score") + xlab("") + 
      scale_y_continuous(limits=c(-0.4, 0.4)) +
    scale_x_continuous(limits=c(1991, 2019),
                     breaks = c(1991, 1996,  2000, 2004, 2004, 2008, 2012, 2014, 2019)) +
  scale_color_manual(name = "",
values = c( "lss_econ" = "grey87", "lss_fight" = "black", "lss_nation" = "grey55"),
labels = c("Responsiveness", "Intimidation", "Patriotism")) +
   theme(legend.position="none", plot.title = element_text(hjust = 0.5, size=16), axis.text=element_text(size=10),
         axis.title=element_text(size=14)) 
ggsave("output/Azerbaijan_LSS3.pdf")


ggplot(subset(LSS, country=="Kyrgyzstan"), 
       aes(x=year, group = country, linetype = country, colour = country)) +
  theme_bw() +
  geom_point(aes(y= lss_econ), colour = "grey87", alpha = 0.2) +
  geom_smooth(aes(y= lss_econ, colour = "lss_econ"), alpha = 0.9, se = FALSE) +
    geom_point(aes(y= lss_fight), colour = "black", alpha = 0.2) +
  geom_smooth(aes(y= lss_fight, colour = "lss_fight"), alpha = 0.9, se = FALSE, span=0.4) +
      geom_point(aes(y= lss_nation), colour = "grey55", alpha = 0.2) +
  geom_smooth(aes(y= lss_nation, colour = "lss_nation"), alpha = 0.9, se = FALSE) +
  ggtitle("Kyrgyzstan") + 
  ylab("Score") + xlab("") + 
   scale_y_continuous(limits=c(-0.4, 0.4))  +
  scale_x_continuous(limits=c(1995, 2019), 
                     breaks = c(1996,  2000, 2004, 2004, 2008, 2012, 2014, 2019)) +
                           scale_color_manual(name = "",
values = c( "lss_econ" = "grey87", "lss_fight" = "black", "lss_nation" = "grey55"),
labels = c("Responsiveness", "Intimidation", "Patriotism")) +
   theme(legend.position="none", plot.title = element_text(hjust = 0.5, size=16), axis.text=element_text(size=10),
         axis.title=element_text(size=14)) 
ggsave("output/Kyrgyzstan_LSS3.pdf")




ggplot(subset(LSS, country=="Turkmenistan"), 
       aes(x=year)) +
  theme_bw() +
  geom_point(aes(y= lss_econ), colour = "grey87", alpha = 0.2) +
  geom_smooth(aes(y= lss_econ, colour = "lss_econ"), alpha = 0.9, se = FALSE) +
    geom_point(aes(y= lss_fight), colour = "black", alpha = 0.2) +
  geom_smooth(aes(y= lss_fight, colour = "lss_fight"), alpha = 0.9, se = FALSE, span=0.4) +
      geom_point(aes(y= lss_nation), colour = "grey55", alpha = 0.2) +
  geom_smooth(aes(y= lss_nation, colour = "lss_nation"), alpha = 0.9, se = FALSE) +
  ggtitle("Turkmenistan") + 
  ylab("Score") + xlab("") + 
   scale_y_continuous(limits=c(-0.4, 0.4))  +
  scale_x_continuous(limits=c(2002, 2019), 
                     breaks = c(2003, 2008, 2012, 2014, 2019)) +                                                                              scale_color_manual(name = "",
values = c( "lss_econ" = "grey87", "lss_fight" = "black", "lss_nation" = "grey55"),
labels = c("Responsiveness", "Intimidation", "Patriotism")) +
   theme(legend.position="bottom", legend.text = element_text(size=16), plot.title = element_text(hjust = 0.5, size=16), axis.text=element_text(size=10), 
         axis.title=element_text(size=14)) 
ggsave("output/Turkmenistan_LSS3.pdf")







#########################################################
##  Figure 2 Appendix: Communicative Strategies Over Time 
#########################################################



ggplot(subset(LSS, country=="Tajikistan"), 
       aes(x=year, group = country, linetype = country, colour = country)) +
  theme_bw() +
  geom_point(aes(y= lss_econ), colour = "red", alpha = 0.2) +
  geom_smooth(aes(y= lss_econ), colour = "red", alpha = 0.9, se = FALSE) +
    geom_point(aes(y= lss_fight), colour = "black", alpha = 0.2) +
  geom_smooth(aes(y= lss_fight), colour = "black", alpha = 0.9, se = FALSE) +
          geom_point(aes(y= lss_nation), colour = "blue", alpha = 0.2) +
  geom_smooth(aes(y= lss_nation, colour = "lss_nation"), alpha = 0.9, se = FALSE) +
  ggtitle("Tajikistan") + 
  ylab("Score") + xlab("") + 
   scale_y_continuous(limits=c(-0.4, 0.4))  +
  scale_x_continuous(limits=c(2002, 2019), 
                     breaks = c(2002, 2004, 2004, 2008, 2012, 2014, 2019)) +
                           scale_color_manual(name = "",
values = c( "lss_econ" = "red", "lss_fight" = "black", "lss_nation" = "blue"),
labels = c("Economy", "Divisive", "Inclusive")) +
   theme(legend.position="none", plot.title = element_text(hjust = 0.5, size=16), axis.text=element_text(size=10),
         axis.title=element_text(size=14)) 
ggsave("output/Tajikistan_LSS3.pdf")



ggplot(subset(LSS, country=="Uzbekistan"), 
       aes(x=year)) +
  theme_bw() +
  geom_point(aes(y= lss_econ), colour = "grey87", alpha = 0.2) +
  geom_smooth(aes(y= lss_econ, colour = "lss_econ"), alpha = 0.9, se = FALSE) +
    geom_point(aes(y= lss_fight), colour = "black", alpha = 0.2) +
  geom_smooth(aes(y= lss_fight, colour = "lss_fight"), alpha = 0.9, se = FALSE, span=0.4) +
      geom_point(aes(y= lss_nation), colour = "grey55", alpha = 0.2) +
  geom_smooth(aes(y= lss_nation, colour = "lss_nation"), alpha = 0.9, se = FALSE) +
  ggtitle("Uzbekistan") + 
  ylab("Score") + xlab("") + 
    scale_x_continuous(limits=c(1991, 2019),
                     breaks = c(1991, 1996,  2000, 2004, 2004, 2008, 2012, 2014, 2019)) +
                                             scale_color_manual(name = "",
values = c( "lss_econ" = "red", "lss_fight" = "black", "lss_nation" = "blue"),
labels = c("Economy", "Divisive", "Inclusive")) +
theme(legend.position="none", plot.title = element_text(hjust = 0.5, size=16), legend.text=element_text(size=14), legend.title=element_text(size=10))
ggsave("output/Uzbekistan_LSS3.pdf")




ggplot(subset(LSS, country=="Ukraine"), 
       aes(x=year, group = country, linetype = country, colour = country)) +
  theme_bw() +
  geom_point(aes(y= lss_econ), colour = "red", alpha = 0.2) +
  geom_smooth(aes(y= lss_econ), colour = "red", alpha = 0.9, se = FALSE) +
    geom_point(aes(y= lss_fight), colour = "black", alpha = 0.2) +
  geom_smooth(aes(y= lss_fight), colour = "black", alpha = 0.9, se = FALSE) +
           geom_point(aes(y= lss_nation), colour = "blue", alpha = 0.2) +
  geom_smooth(aes(y= lss_nation, colour = "lss_nation"), alpha = 0.9, se = FALSE) +
  ggtitle("Ukraine") + 
  ylab("Score") + xlab("Year") + 
    scale_y_continuous(limits=c(-0.4, 0.4)) +
    scale_x_continuous(limits=c(1991, 2019),
                     breaks = c(1991, 1996,  2000, 2004, 2004, 2008, 2012, 2014, 2019)) +
                      scale_color_manual(name = "",
values = c( "lss_econ" = "red", "lss_fight" = "black", "lss_nation" = "blue"),
labels = c("Economy", "Divisive", "Inclusive")) +
  theme(legend.position="none", plot.title = element_text(hjust = 0.5, size=16), axis.text=element_text(size=10),
         axis.title=element_text(size=14)) 
ggsave("output/Ukraine_LSS3.pdf")


ggplot(subset(LSS, country=="Georgia"), 
       aes(x=year, group = country, linetype = country, colour = country)) +
  theme_bw() +
  geom_point(aes(y= lss_econ), colour = "red", alpha = 0.2) +
  geom_smooth(aes(y= lss_econ), colour = "red", alpha = 0.9, se = FALSE) +
    geom_point(aes(y= lss_fight), colour = "black", alpha = 0.2) +
  geom_smooth(aes(y= lss_fight), colour = "black", alpha = 0.9, se = FALSE) +
             geom_point(aes(y= lss_nation), colour = "blue", alpha = 0.2) +
  geom_smooth(aes(y= lss_nation, colour = "lss_nation"), alpha = 0.9, se = FALSE) +
  ggtitle("Georgia") + 
  ylab("Score") + xlab("Year") + 
    scale_y_continuous(limits=c(-0.4, 0.4)) +
    scale_x_continuous(limits=c(1993, 2019),
                     breaks = c(1993, 1996,  2000, 2004, 2004, 2008, 2012, 2014, 2019)) +
                                           scale_color_manual(name = "",
values = c( "lss_econ" = "red", "lss_fight" = "black", "lss_nation" = "blue"),
labels = c("Economy", "Divisive", "Inclusive")) +
  theme(legend.position="none", plot.title = element_text(hjust = 0.5, size=16), axis.text=element_text(size=10),
         axis.title=element_text(size=14)) 
ggsave("output/Georgia_LSS3.pdf")


ggplot(subset(LSS, country=="Abkhazia"), 
       aes(x=year, group = country, linetype = country, colour = country)) +
  theme_bw() +
  geom_point(aes(y= lss_econ), colour = "red", alpha = 0.2) +
  geom_smooth(aes(y= lss_econ), colour = "red", alpha = 0.9, se = FALSE) +
    geom_point(aes(y= lss_fight), colour = "black", alpha = 0.2) +
  geom_smooth(aes(y= lss_fight), colour = "black", alpha = 0.9, se = FALSE) +
             geom_point(aes(y= lss_nation), colour = "blue", alpha = 0.2) +
  geom_smooth(aes(y= lss_nation, colour = "lss_nation"), alpha = 0.9, se = FALSE) +
  ggtitle("Abkhazia") + 
  ylab("Score") + xlab("Year") + 
    scale_y_continuous(limits=c(-0.4, 0.4)) +
    scale_x_continuous(limits=c(2000, 2019),
                     breaks = c( 2000, 2004, 2004, 2008, 2012, 2014, 2019)) +
                                           scale_color_manual(name = "",
values = c( "lss_econ" = "red", "lss_fight" = "black", "lss_nation" = "blue"),
labels = c("Economy", "Divisive", "Inclusive")) +
  theme(legend.position="none", plot.title = element_text(hjust = 0.5, size=16), axis.text=element_text(size=10),
         axis.title=element_text(size=14)) 
ggsave("output/Abkhazia_LSS3.pdf")


	ggplot(subset(LSS, country=="Armenia"), 
	       aes(x=year, group = country, linetype = country, colour = country)) +
	  theme_bw() +
	  geom_point(aes(y= lss_econ), colour = "red", alpha = 0.2) +
	  geom_smooth(aes(y= lss_econ), colour = "red", alpha = 0.9, se = FALSE) +
	    geom_point(aes(y= lss_fight), colour = "black", alpha = 0.2) +
	  geom_smooth(aes(y= lss_fight), colour = "black", alpha = 0.9, se = FALSE) +
	             geom_point(aes(y= lss_nation), colour = "blue", alpha = 0.2) +
	  geom_smooth(aes(y= lss_nation, colour = "lss_nation"), alpha = 0.9, se = FALSE) +
	  ggtitle("Armenia") + 
	  ylab("Score") + xlab("Year") + 
	    scale_y_continuous(limits=c(-0.4, 0.4)) +
	    scale_x_continuous(limits=c(2007, 2019),
	                     breaks = c( 2007, 2008, 2012, 2014, 2019)) +
	                                           scale_color_manual(name = "",
	values = c( "lss_econ" = "red", "lss_fight" = "black", "lss_nation" = "blue"),
	labels = c("Economy", "Divisive", "Inclusive")) +
	  theme(legend.position="none", plot.title = element_text(hjust = 0.5, size=16), axis.text=element_text(size=10),
	         axis.title=element_text(size=14)) 
	ggsave("output/Armenia_LSS3.pdf")
	
		ggplot(subset(LSS, country=="DNR"), 
	       aes(x=year, group = country, linetype = country, colour = country)) +
	  theme_bw() +
	  geom_point(aes(y= lss_econ), colour = "red", alpha = 0.2) +
	  geom_smooth(aes(y= lss_econ), colour = "red", alpha = 0.9, se = FALSE) +
	    geom_point(aes(y= lss_fight), colour = "black", alpha = 0.2) +
	  geom_smooth(aes(y= lss_fight), colour = "black", alpha = 0.9, se = FALSE) +
	             geom_point(aes(y= lss_nation), colour = "blue", alpha = 0.2) +
	  geom_smooth(aes(y= lss_nation, colour = "lss_nation"), alpha = 0.9, se = FALSE, span=0.4) +
	  ggtitle("DNR") + 
	  ylab("Score") + xlab("Year") + 
	    scale_y_continuous(limits=c(-0.4, 0.8)) +
	    scale_x_continuous(limits=c(2014, 2019),
	                     breaks = c( 2014, 2016, 2019)) +
	                                           scale_color_manual(name = "",
	values = c( "lss_econ" = "red", "lss_fight" = "black", "lss_nation" = "blue"),
	labels = c("Economy", "Divisive", "Inclusive")) +
	  theme(legend.position="none", plot.title = element_text(hjust = 0.5, size=16), axis.text=element_text(size=10),
	         axis.title=element_text(size=14)) 
	ggsave("output/DNR_LSS3.pdf")


		ggplot(subset(LSS, country=="LNR"), 
	       aes(x=year, group = country, linetype = country, colour = country)) +
	  theme_bw() +
	  geom_point(aes(y= lss_econ), colour = "red", alpha = 0.2) +
	  geom_smooth(aes(y= lss_econ), colour = "red", alpha = 0.9, se = FALSE) +
	    geom_point(aes(y= lss_fight), colour = "black", alpha = 0.2) +
	  geom_smooth(aes(y= lss_fight), colour = "black", alpha = 0.9, se = FALSE) +
	             geom_point(aes(y= lss_nation), colour = "blue", alpha = 0.2) +
	  geom_smooth(aes(y= lss_nation, colour = "lss_nation"), alpha = 0.9, se = FALSE) +
	  ggtitle("LNR") + 
	  ylab("Score") + xlab("Year") + 
	    scale_y_continuous(limits=c(-0.5, 0.8)) +
	    scale_x_continuous(limits=c(2014, 2019),
	                     breaks = c( 2014, 2016, 2019)) +
	                                           scale_color_manual(name = "",
	values = c( "lss_econ" = "red", "lss_fight" = "black", "lss_nation" = "blue"),
	labels = c("Economy", "Divisive", "Inclusive")) +
	  theme(legend.position="none", plot.title = element_text(hjust = 0.5, size=16), axis.text=element_text(size=10),
	         axis.title=element_text(size=14)) 
	ggsave("output/LNR_LSS3.pdf")
	
	
		ggplot(subset(LSS, country=="Moldova"), 
	       aes(x=year, group = country, linetype = country, colour = country)) +
	  theme_bw() +
	  geom_point(aes(y= lss_econ), colour = "red", alpha = 0.2) +
	  geom_smooth(aes(y= lss_econ), colour = "red", alpha = 0.9, se = FALSE) +
	    geom_point(aes(y= lss_fight), colour = "black", alpha = 0.2) +
	  geom_smooth(aes(y= lss_fight), colour = "black", alpha = 0.9, se = FALSE) +
	             geom_point(aes(y= lss_nation), colour = "blue", alpha = 0.2) +
	  geom_smooth(aes(y= lss_nation, colour = "lss_nation"), alpha = 0.9, se = FALSE) +
	  ggtitle("Moldova") + 
	  ylab("Score") + xlab("Year") + 
	    scale_y_continuous(limits=c(-0.4, 0.4)) +
	    scale_x_continuous(limits=c(2002, 2019),
	                     breaks = c( 2002, 2008, 2012, 2014, 2019)) +
	                                           scale_color_manual(name = "",
	values = c( "lss_econ" = "red", "lss_fight" = "black", "lss_nation" = "blue"),
	labels = c("Economy", "Divisive", "Inclusive")) +
	  theme(legend.position="none", plot.title = element_text(hjust = 0.5, size=16), axis.text=element_text(size=10),
	         axis.title=element_text(size=14)) 
	ggsave("output/Moldova_LSS3.pdf")
	
	
			ggplot(subset(LSS, country=="NKR"), 
	       aes(x=year, group = country, linetype = country, colour = country)) +
	  theme_bw() +
	  geom_point(aes(y= lss_econ), colour = "red", alpha = 0.2) +
	  geom_smooth(aes(y= lss_econ), colour = "red", alpha = 0.9, se = FALSE) +
	    geom_point(aes(y= lss_fight), colour = "black", alpha = 0.2) +
	  geom_smooth(aes(y= lss_fight), colour = "black", alpha = 0.9, se = FALSE) +
	             geom_point(aes(y= lss_nation), colour = "blue", alpha = 0.2) +
	  geom_smooth(aes(y= lss_nation, colour = "lss_nation"), alpha = 0.9, se = FALSE) +
	  ggtitle("Nagorno-Karabakh") + 
	  ylab("Score") + xlab("Year") + 
	    scale_y_continuous(limits=c(-0.4, 1.2)) +
	    scale_x_continuous(limits=c(2008, 2019),
	                     breaks = c( 2008, 2010, 2014, 2019)) +
	                                           scale_color_manual(name = "",
	values = c( "lss_econ" = "red", "lss_fight" = "black", "lss_nation" = "blue"),
	labels = c("Economy", "Divisive", "Inclusive")) +
	  theme(legend.position="none", plot.title = element_text(hjust = 0.5, size=16), axis.text=element_text(size=10),
	         axis.title=element_text(size=14)) 
	ggsave("output/NKR_LSS3.pdf")
	
				ggplot(subset(LSS, country=="PMR"), 
	       aes(x=year, group = country, linetype = country, colour = country)) +
	  theme_bw() +
	  geom_point(aes(y= lss_econ), colour = "red", alpha = 0.2) +
	  geom_smooth(aes(y= lss_econ), colour = "red", alpha = 0.9, se = FALSE) +
	    geom_point(aes(y= lss_fight), colour = "black", alpha = 0.2) +
	  geom_smooth(aes(y= lss_fight), colour = "black", alpha = 0.9, se = FALSE) +
	             geom_point(aes(y= lss_nation), colour = "blue", alpha = 0.2) +
	  geom_smooth(aes(y= lss_nation, colour = "lss_nation"), alpha = 0.9, se = FALSE) +
	  ggtitle("Transdnistria") + 
	  ylab("Score") + xlab("Year") + 
	    scale_y_continuous(limits=c(-0.4, 0.4)) +
	    scale_x_continuous(limits=c(2009, 2019),
	                     breaks = c( 2009, 2010, 2014, 2019)) +
	                                           scale_color_manual(name = "",
	values = c( "lss_econ" = "red", "lss_fight" = "black", "lss_nation" = "blue"),
	labels = c("Economy", "Divisive", "Inclusive")) +
	  theme(legend.position="none", plot.title = element_text(hjust = 0.5, size=16), axis.text=element_text(size=10),
	         axis.title=element_text(size=14)) 
	ggsave("output/PMR_LSS3.pdf")
	
					ggplot(subset(LSS, country=="SO"), 
	       aes(x=year, group = country, linetype = country, colour = country)) +
	  theme_bw() +
	  geom_point(aes(y= lss_econ), colour = "red", alpha = 0.2) +
	  geom_smooth(aes(y= lss_econ), colour = "red", alpha = 0.9, se = FALSE) +
	    geom_point(aes(y= lss_fight), colour = "black", alpha = 0.2) +
	  geom_smooth(aes(y= lss_fight), colour = "black", alpha = 0.9, se = FALSE) +
	             geom_point(aes(y= lss_nation), colour = "blue", alpha = 0.2) +
	  geom_smooth(aes(y= lss_nation, colour = "lss_nation"), alpha = 0.9, se = FALSE) +
	  ggtitle("South Ossetia") + 
	  ylab("Score") + xlab("Year") + 
	    scale_y_continuous(limits=c(-0.4, 1.5)) +
	    scale_x_continuous(limits=c(2013, 2019),
	                     breaks = c( 2013, 2016, 2019)) +
	                                           scale_color_manual(name = "",
	values = c( "lss_econ" = "red", "lss_fight" = "black", "lss_nation" = "blue"),
	labels = c("Economy", "Divisive", "Inclusive")) +
	  theme(legend.position="none", plot.title = element_text(hjust = 0.5, size=16), axis.text=element_text(size=10),
	         axis.title=element_text(size=14)) 
	ggsave("output/SO_LSS3.pdf")
	



###########################################################################
##  Figure 1 Appendix: LSS Scores for the Three Communication Strategies 
###########################################################################


library(haven)
LSS <- read_dta("estimation_file.dta")




	(fight.time <- ggplot(data=LSS, aes(year, country)) 
	+ geom_tile(aes(fill = lss_fight), colour = "white") 
	+ scale_fill_gradient2(name="Value", low = "lightgrey", mid = "grey", high ="black", 
	                       midpoint = -0.06,
	                       space = "Lab", na.value = "grey", guide = "colourbar") 
	                        +    ylab("") + xlab("") 
	     +  theme(axis.text.y = element_text(size = 9, angle = 360,hjust=1,vjust=0.5))                  
	+  theme(axis.text.x = element_text(size = 9, angle=45, hjust=1,vjust=0.5))
	+  theme(axis.ticks=element_blank()) +  scale_x_continuous(name="", breaks = seq(1991, 2019, 2), 
	                     labels = seq(1991, 2019, 2),
	                     limits = c(1991,2019))
		+ ggtitle("Intimidation")+ theme(legend.position="bottom",  legend.title=element_text(size=0),  legend.text=element_text(size=8), panel.grid.minor=element_blank(), plot.title = element_text(hjust = 0.5), panel.grid.major=element_blank())
		)

ggsave("output/heatmap_fight.pdf")



			(econ.time <- ggplot(data=LSS, aes(year, country)) 
		+ geom_tile(aes(fill = lss_econ), colour = "white") 
	+ scale_fill_gradient2(name="Value", low = "lightgrey", mid = "grey", high ="black", 
		                       midpoint = 0.07,
		                       space = "Lab", na.value = "grey", guide = "colourbar") 
		                    +    ylab("") + xlab("") 
		     +  theme(axis.text.y = element_text(size = 7, angle = 360,hjust=1,vjust=0.5))                  
		+  theme(axis.text.x = element_text(size = 7, angle=45, hjust=1,vjust=0.5))
		+  theme(axis.ticks=element_blank()) +  scale_x_continuous(name="", breaks = seq(1991, 2019, 2), 
		                     labels = seq(1991, 2019, 2),
		                     limits = c(1991,2019))		                     
		+ ggtitle("Responsiveness")+ theme(legend.position="bottom",  legend.title=element_text(size=0),  legend.text=element_text(size=8), panel.grid.minor=element_blank(), plot.title = element_text(hjust = 0.5), panel.grid.major=element_blank())
		)

ggsave("output/heatmap_econ.pdf")



			(econ.time <- ggplot(data=LSS, aes(year, country)) 
		+ geom_tile(aes(fill = lss_nation), colour = "white") 
	+ scale_fill_gradient2(name="Value", low = "lightgrey", mid = "grey", high ="black",
		                       midpoint = -0.08,
		                       space = "Lab", na.value = "grey", guide = "colourbar") 
		                    +    ylab("") + xlab("") 
		     +  theme(axis.text.y = element_text(size = 7, angle = 360,hjust=1,vjust=0.5))                  
		+  theme(axis.text.x = element_text(size = 7, angle=45, hjust=1,vjust=0.5))
		+  theme(axis.ticks=element_blank()) +  scale_x_continuous(name="", breaks = seq(1991, 2019, 2), 
		                     labels = seq(1991, 2019, 2),
		                     limits = c(1991,2019))		                     
		+ ggtitle("Patriotism")+ theme(legend.position="bottom",  legend.title=element_text(size=0),  legend.text=element_text(size=8), panel.grid.minor=element_blank(), plot.title = element_text(hjust = 0.5), panel.grid.major=element_blank())
		)
ggsave("output/heatmap_nation.pdf")


ggplot(subset(LSS), 
       aes(x=year)) +
  theme_bw() +
  geom_point(aes(y= lss_econ), colour = "red", alpha = 0.2) +
  geom_smooth(aes(y= lss_econ, colour = "lss_econ"), alpha = 0.9, se = FALSE) +
    geom_point(aes(y= lss_fight), colour = "black", alpha = 0.2) +
  geom_smooth(aes(y= lss_fight, colour = "lss_fight"), alpha = 0.9, se = FALSE) +
      geom_point(aes(y= lss_nation), colour = "blue", alpha = 0.2) +
  geom_smooth(aes(y= lss_nation, colour = "lss_nation"), alpha = 0.9, se = FALSE) +
  ggtitle("All countries") + 
  ylab("Score") + xlab("Year") + 
  scale_y_continuous(limits=c(-0.4, 0.4), breaks = c(-0.25, 0, 0.25 )) +
  scale_x_continuous(limits=c(1991, 2019), 
                     breaks = c(1991, 1996,  2000, 2004, 2004, 2008, 2012, 2014, 2019)) +
  scale_color_manual(name = "",
values = c( "lss_econ" = "red", "lss_fight" = "black", "lss_nation" = "blue"),
labels = c("Responsiveness", "Intimidation", "Patriotism")) +
theme(legend.position="bottom", plot.title = element_text(hjust = 0.5), legend.text=element_text(size=12), legend.title=element_text(size=8))
ggsave("output/all_LSS3.pdf")

 
